<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
	</head>
	<body>
		<form id="formTab5">
			<fieldset>
				<legend>
					费用情况
				</legend>
				<table class="layout-table">
					<colgroup>
						<col width="20%"/>
						<col width="30%"/>
						<col width="20%"/>
						<col width="30%"/>
					</colgroup>
					<tr>
						<td align="right"><label for="ADA01"> 总费用: </label></td>
						<td>
						<input class="easyui-numberbox" min="0.01" precision="2" type="text" id="ADA01" name="ADA01" required="true"/>
						</td>
						<td align="right"><label for="ADA0101"> 自付金额: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA0101" name="ADA0101" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA11"> 诊察（诊疗）费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA11" name="ADA11" />
						</td>
						<td align="right"><label for="ADA21"> 一般检查费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA21" name="ADA21" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA22"> 临床物理治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA22" name="ADA22" />
						</td>
						<td align="right"><label for="ADA23"> 介入治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA23" name="ADA23" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA24"> 特殊治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA24" name="ADA24" />
						</td>
						<td align="right"><label for="ADA25"> 康复治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA25" name="ADA25" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA26"> 中医治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA26" name="ADA26" />
						</td>
						<td align="right"><label for="ADA27"> 一般治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA27" name="ADA27" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA28"> 精神治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA28" name="ADA28" />
						</td>
						<td align="right"><label for="ADA13"> 接生费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA13" name="ADA13" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA15"> 麻醉费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA15" name="ADA15" />
						</td>
						<td align="right"><label for="ADA12"> 手术费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA12" name="ADA12" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA29"> 护理治疗费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA29" name="ADA29" />
						</td>
						<td align="right"><label for="ADA03"> 护理费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA03" name="ADA03" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA30"> 核素检查: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA30" name="ADA30" />
						</td>
						<td align="right"><label for="ADA31"> 核素治疗: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA31" name="ADA31" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA32"> 超声费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA32" name="ADA32" />
						</td>
						<td align="right"><label for="ADA07"> 放射费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA07" name="ADA07" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA08"> 化验费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA08" name="ADA08" />
						</td>
						<td align="right"><label for="ADA33"> 病理费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA33" name="ADA33" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA34"> 监护及辅助呼吸费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA34" name="ADA34" />
						</td>
						<td align="right"><label for="ADA35"> 治疗用一次性医用材料费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA35" name="ADA35" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA36"> 介入用一次性医用材料费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA36" name="ADA36" />
						</td>
						<td align="right"><label for="ADA37"> 手术用一次性医用材料费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA37" name="ADA37" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA38"> 检查用一次性医用材料费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA38" name="ADA38" />
						</td>
						<td align="right"><label for="ADA02"> 床位费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA02" name="ADA02" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA39"> 挂号费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA39" name="ADA39" />
						</td>
						<td align="right"><label for="ADA09"> 输氧费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA09" name="ADA09" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA10"> 输血费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA10" name="ADA10" />
						</td>
						<td align="right"><label for="ADA04"> 西药费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA04" name="ADA04" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA40"> 抗菌药物费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA40" name="ADA40" />
						</td>
						<td align="right"><label for="ADA41"> 白蛋白类制品费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA41" name="ADA41" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA42"> 球蛋白类制品费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA42" name="ADA42" />
						</td>
						<td align="right"><label for="ADA43"> 凝血因子类制品费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA43" name="ADA43" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA44"> 细胞因子类制品费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA44" name="ADA44" />
						</td>
						<td align="right"><label for="ADA05"> 中成药费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA05" name="ADA05" />
						</td>
					</tr>
					<tr>
						<td align="right"><label for="ADA06"> 中草药费: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA06" name="ADA06" />
						</td>
						<td align="right"><label for="ADA20"> 其他费用: </label></td>
						<td>
						<input class="easyui-numberbox" min="0" precision="2" type="text" id="ADA20" name="ADA20" />
						</td>
					</tr>
				</table>
			</fieldset>
		</form>
		<form id="medi_case" name="medi_case" action="" method="post">
			<input id="pk" name="pk" type="hidden" />
			<input id="xmlStr" name="xmlStr" type="hidden" />
		</form>
		<table class="layout-table">
			<tr>
				<td align="right">
				<a id="btn_submit" href="#" class="easyui-linkbutton">提交</a>
				<script type="text/javascript">
					$(function() {
						$("#btn_submit").click(function() {
							$.blockUI({ css: { 
            								border: 'none', 
            								padding: '15px', 
            								backgroundColor: '#000', 
            								'-webkit-border-radius': '10px', 
            								'-moz-border-radius': '10px', 
            								opacity: .5, 
            								color: '#fff' 
        					} ,message:"<b>请稍后...</b>" });
							if(!validExpenses()){
								$.unblockUI({ 
              						 onUnblock: function(){ 
									 	alert("[总费用]应等于其他详细费用之和！") 
									 } 
           						}); 
								return false;
							}
							var isvalid = checkValid();
							if (!isvalid) {
								$.unblockUI({ 
               						 onUnblock: function(){ 
									 	alert("输入数据有误，请修正！") 
									 } 
            					}); 
								return false;
							}
							var xmlWriter = new CaseXmlWriter();
							var xmlStr = xmlWriter.generateCase();
							//alert(xmlStr);
							//return true;
							$.post("SaveServlet", {
								"xmlStr" : xmlStr,
								"pk_case" : $("#pk").val()
							}, function(data) {
								var result = eval("("+data+")");
								$("#pk").val(result.pk);
								//将id设置到当前记录中
								var record = window.dataset.getCurrent();
								record["id"]=result.pk;
								$.unblockUI({ 
               						 onUnblock: function(){
									 	alert(result.msg);
									 }
            					});
							}, "text");
						});
					});

				</script></td>
				<td>&nbsp;&nbsp;
				<a id="btn_export" href="#" class="easyui-linkbutton">导出到本地</a>
				<script type="text/javascript">
					$(function() {
						$("#btn_export").click(function() {
							var isvalid = checkValid();
							if(!isvalid) {
								alert("输入数据有误，请修正！")
								return false;
							}
							var xmlWriter = new CaseXmlWriter();
							var xmlStr = xmlWriter.generateCase();
							$("#xmlStr").val(xmlStr);
							$("#medi_case").attr("action", "DownloadServlet");
							$("#medi_case").submit();
						});
					});

				</script></td>
			</tr>
		</table>
	</body>
</html>